package com.woniuxy.commentservice.service.xxljob;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.List;

@Component
public class TaskJob {
//    @Autowired
//    private VipUserMapper vipUserMapper;
    @XxlJob("TaskJob")
    public void taskJobHandler()throws Exception{
//        System.out.println("执行检查会员任务");
//        List<VipUser> list = new LambdaQueryChainWrapper<VipUser>(vipUserMapper)
//                .eq(VipUser::getState, 1).list();
//        for (VipUser vipUser : list) {
//            LocalDateTime nowTime = LocalDateTime.now();
//            int result = nowTime.compareTo(vipUser.getEndTime());
//            if (result>0){
//                vipUserMapper.deleteById(vipUser);//去掉会员身份
//            }
//        }
    }
}
